package com.cjq.user.controller;

import com.cjq.common.domain.User;
import com.cjq.common.result.Result;
import com.cjq.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    /**
     * 手机号查询用户
     * @param phone
     * @return
     */
    @PostMapping("/findUser/{phone}")
    public Result<User> findUser(@PathVariable String phone){
        User user = userService.findUser(phone);
        return Result.success(user);
    }
}
